-
Notifications
You must be signed in to change notification settings - Fork 46
Using the DEFAULT_TASK_BACKEND_ALIAS constant #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using the DEFAULT_TASK_BACKEND_ALIAS constant #36
Conversation
| from .backends.base import BaseTaskBackend | ||
|
|
||
| DEFAULT_QUEUE_NAME = "default" | ||
| DEFAULT_TASK_BACKEND_ALIAS = "default" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am really not sure about the location of that constant. The locations where I wanted to put it produced circular imports, though...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is why I just duplicated it instead. Tests should cover if they're different.
… default task backend.
1447f9e to
4a623b0
Compare
| # Can be replaced with `django.conf.global_settings` once vendored. | ||
| return { | ||
| "default": { | ||
| DEFAULT_TASK_BACKEND_ALIAS: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion: As discussed, we should document that it should be called "default" (as with DATABASES).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But even if discarding the rest of the PR, we could still reference that variable instead of writing default again, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
DEFAULT_TASK_BACKEND_ALIAS isn't really part of the public API, so people shouldn't need to use it.
|
This PR obviously isn't crucial for the projects success and mostly I question of taste. Looking at the alternatives, I would prefer using the constant in the non-test code as implemented by this PR. If you agree, let's merge it. If you don't agree, feel free to close this PR. 🙃 |
Using the
DEFAULT_TASK_BACKEND_ALIASconstant when referencing to the default task backend instead of repeating the string.